#{extends 'mainStage.html' /}
#{set title:'Modifier un stage'/}
<style type="text/css"> 
@import "../../../public/javascripts/jquery-ui-1.8.13.custom/css/ui-lightness/jquery-ui-1.8.13.custom.css";
</style>
<script type="text/javascript" src="../../../public/javascripts/jquery-ui-1.8.13.custom/js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="../../../public/javascripts/jquery-ui-1.8.13.custom/development-bundle/ui/i18n/jquery.ui.datepicker-fr.js"></script>
<SCRIPT TYPE="text/javascript" SRC="../../../public/javascripts/filterlist.js"></SCRIPT> 

<SCRIPT>
	$(function() {
		$( "#dateDeb" ).datepicker();
		$( "#dateFin" ).datepicker();
		$( "#dateExam" ).datepicker();
	});
</SCRIPT>

#{if stage!=null}
<div id="menu_right">
    <p>
        <a href="@{Stages.listStages}">Liste des stages</a>
    </p>
</div>

<h3>Modifier le stage ${stage}</h3>
     
#{form @modifStageAdminSave()}
	<input type="hidden" value="${stage.id}" id="stageId" name="stageId"/>
	<p>
 	    <label for="code">Code* :</label>
        <input type="text" name="code" id="code" value="${stage?.code}" />
    </p>
    <p>
 	    <label for="intitule">Intitul&eacute;* :</label>
        #{select 'intitule', items:intitules, id:'intitule', value:stage?.intitule?.id, name:'intitule', valueProperty:'id'}
            #{option}-- Choisir une valeur --#{/option}
		#{/select}
    </p>
	<p>
 	    <label for="structure">Structure* :</label>
        #{select 'groupement', items:structures, value:stage?.structure?.id, valueProperty:'id', id:'groupement'}
            #{option 0}-- Choisir une valeur --#{/option}
        #{/select}
    </p>
    <p>
 	    <label for="cis">Lieu :</label>
        #{select 'cis', items:ciss, id:'cis', value:stage?.cis?.id, valueProperty:'id'}
            #{option 0}-- Choisir une valeur --#{/option}
        #{/select}
        
    </p>
    <p>
 	    <label for="nature">Nature* :</label>
        #{select 'nature', items:natures, id:'nature', value:stage?.nature?.id, valueProperty:'id'}
          #{option 0}-- Choisir une valeur --#{/option}
        #{/select}
    </p>
    <p>
       	<label for="description">Description :</label>
    	<textarea name="description" id="description" >${stage?.description}</textarea>
    </p>
    <p>
       	<label for="modalites">Modalit&eacute;s :</label>
    	<textarea name="modalites" id="modalites" >${stage?.modalites}</textarea>
    </p>
    <p>
        <label for="duree">Dur&eacute;e (en jours)* :</label>
        #{select 'duree', items:durees, valueProperty:'id', id:'duree', value:stage?.duree.id}
            #{option 0}-- Choisir une valeur --#{/option}
        #{/select}
    </p>
    <p>
        <label for="dateDeb">Date de d&eacute;but (dd/mm/yyyy) :</label>
        #{if dateDeb == null}
            <input type="text" name="dateDeb" id="dateDeb" value="${stage?.dateDeb?.format('dd/MM/yyyy','fr')}" />
        #{/if}
        #{else}
            <input type="text" name="dateDeb" id="dateDeb" value="${stage?.dateDeb?.format('dd/MM/yyyy','fr')}" />
        #{/else}
    </p>
    <p>
    <label for="dateFin">Date de fin (dd/mm/yyyy) :</label>
        #{if dateFin == null}
            <input type="text" name="dateFin" id="dateFin" value="${stage?.dateFin?.format('dd/MM/yyyy','fr')}" />
        #{/if}
        #{else}
            <input type="text" name="dateFin" id="dateFin" value="${stage?.dateFin?.format('dd/MM/yyyy','fr')}" />
        #{/else}
    <p>
    <p>
		<label for="dateExam">Nouvelle date d'examen : </label>	    	
		<input type="text" name="dateExam" id="dateExam" value="${stage?.dateExam?.format('dd/MM/yyyy','fr')}" />		
	</p>
 	<p>
 	    <label for="effectifMin">effectifMin* :</label>
        <input type="text" name="effectifMin" id="effectifMin" value="${stage?.effectifMin}" />
    </p>
 	<p>
 	<label for="effectifMax">effectifMax* :</label>
        <input type="text" name="effectifMax" id="effectifMax" value="${stage?.effectifMax}" />
    </p>
    <br />
    <p style="margin-top:30px">    
        <center><input type="submit" value="Enregistrer le stage" /></center>
    </p>
    <p style="font-size:16px;"><i>* Champs obligatoires<i></p>
#{/form}
#{/if}
#{else}
	Ce stage n'existe pas !
#{/else}
